//
//  ChangePasswordViewController.swift
//  SidebarMenu
//
//  Created by LiangXiaobin on 2017/2/6.
//  Copyright © 2017年 AppCoda. All rights reserved.
//

import UIKit

class ChangePasswordViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {

    var tableView:UITableView?
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        topTittle?.text = "修改密码"
        rightBtn?.isHidden = false
        rightBtn?.setTitle("提交", for: .normal)
        
        
        tableView = UITableView(frame:CGRect(x:0,y:64,width:screenWidth,height:screenHeight - 64))
        tableView?.separatorStyle = .none
        tableView?.backgroundColor = UIColor.white
        tableView?.register(UINib(nibName: "CPTableViewCell", bundle: Bundle.main), forCellReuseIdentifier: "CPTableViewCell")
        tableView?.delegate = self
        tableView?.dataSource = self
        self.view.addSubview(tableView!)
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
     func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 1
    }
    
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return 3
    }
    
    
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        
        let cellIdentifier = "CPTableViewCell"
        
        var cell:CPTableViewCell? = tableView.dequeueReusableCell(withIdentifier: cellIdentifier) as? CPTableViewCell
        if !(cell != nil) {
            cell = CPTableViewCell(style:.default, reuseIdentifier:cellIdentifier)
        }
        
        
        
        
        return cell!
    }
    
    
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        
        return 80
    }
    
    
    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 11
    }
    
    
    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        
        let view = UIView(frame:CGRect(x:0,y:0,width:screenWidth,height:11))
        let lineView = UIView(frame:CGRect(x:0,y:10,width:screenWidth,height:1))
        lineView.backgroundColor = grayColor
        view.addSubview(lineView)
        return view
        
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
